package com.springcloud.zull.feign;

import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import utils.ResponseBean;

/**
 * @author wfh
 */
@Component
@Slf4j
public class Service1GetFallBack implements FallbackFactory<Service1GetFeignClient> {


    @Override
    public Service1GetFeignClient create(final Throwable throwable) {
        return new Service1GetFeignClient() {
            @Override
            public ResponseBean get() {

                throwable.printStackTrace();
                log.info("reason:" + throwable.getMessage());
//                return ResponseBean.fail();
                return ResponseBean.fail("xscsdcsdc陈先生城市打车");
            }

            @Override
            public Object get2() {
                return "cdscdscdcdscdscdsc";
            }
        };
    }
}
